package com.micro.train.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.micro.train.entity.TrainCarriage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 火车车厢数据访问接口
 */
@Mapper
public interface TrainCarriageRepository extends BaseMapper<TrainCarriage> {
    
    /**
     * 根据列车ID获取所有车厢
     */
    List<TrainCarriage> selectByTrainId(@Param("trainId") Long trainId);
    
    /**
     * 根据车厢类型获取车厢
     */
    List<TrainCarriage> selectByCarriageType(@Param("carriageType") Integer carriageType);
    
    /**
     * 根据列车ID和车厢类型获取车厢
     */
    List<TrainCarriage> selectByTrainIdAndCarriageType(@Param("trainId") Long trainId, 
                                                      @Param("carriageType") Integer carriageType);
}
